<div style="float:right;"> <a href="<?= $member_base_url; ?>student/bank/<?=$id;?>/<?php echo $cur_page;?>" >  Admin Bank Details  </a> </div>
<table >
<tr> 
		<td>
           Country :
		</td>
        <td>
        
		<?php
		echo $form['countries']; 
		?>

		</td>
	</tr>
 
    <tr> 
		<td>
         Total Amount <br/> to pay 
		</td>
        <td>
        
		 <?php
  echo $form['price'];  ?>

		</td>
	</tr>
</table>
<?php
	$pAmount =0;
	if(!empty($payments))
	{
		?>
        <table id="tbllist" style="width:100%">
    
	<tr> <th> Amount paid </th> <th> Bank </th> <th> Branch </th> <th> Account No </th> <th> Challan No </th><th> Remarks </th>	<th> Date </th> </tr>
        <?php
		foreach($payments as $p)
		{?>
        

     <tr>
  
    <td>
    <?php
	$pAmount+= $p['payment_amount'];
	echo $p['payment_amount'];
	?>
    </td> 
   
    <td>
     <?php
	echo $p['bank'];
	?>
     </td>
     <td>
     <?php
	echo $p['branch'];
	?>
     </td>
     <td>
     <?php
	echo $p['account_no'];
	?>
     </td>
     <td>
     <?php
	echo $p['challan_no'];
	?>
     </td>
     <td>
     <?php
	 echo $p['remarks'];
	 ?>
     </td>
    
    <td> 
    <?php
	echo $p['updated'];
	?>
     </td>
    
     </tr>
    <?php
	}
	?>
    <tr>
    <td>
    Total Amount paid 
    </td>
    <td colspan="2">
     <?php
	 echo $pAmount;
	 ?>
    </td>
    </tr>
     <tr>
     
     <td>
     Balance
     </td>
     <td colspan="2">
     <?php
     $balance = $form['price']-$pAmount ;
	 echo $balance;
	 ?>
     </td>
     </tr>
</table>

<?php
		
	}
	 ?>
<form  method="post" action="<?= $member_base_url; ?>student/payment/<?=$id;?>/<?php echo $cur_page;?>"/>

<br/>



  <br/>
 
<table  id="tblform">
<tbody>
	
  
    <tr> 
		<td>
         Amount going to pay: 
		</td>
        <td>
        <input type="hidden" name="user_id" value="<?php echo $student['sid']; ?>" />
      <input type="text" name="payment_amount"/>

		</td>
	</tr>
    <tr>
       <td>Bank  </td>
       <td> <input type="text" name="bank"/> </td>
    </tr>
     <tr>
       <td> Branch Name </td>
       <td> <input type="text" name="branch"/> </td>
    </tr>
    <tr>
    <td> Account No </td>
    <td> <input type="text" name="account_no"/> </td>
    </tr>
     <tr>
       <td> Challan Number</td>
       <td> <input type="text" name="challan_no"/> </td>
    </tr>
    
     <tr> 
		<td>
         Remark 
		</td>
        <td>
      <textarea name="remarks"> </textarea>

		</td>
	</tr>

	 <tr>
     <td colspan="2">
     <div class="buttons">
			    <button type="submit" name="save" class="submit" value="save" >
			        <img src="<?php echo $member_image_path?>icons/apply.png" alt=""/>
			          <?php if(!empty($id)) { ?>
 							Update 
 							<input type="hidden" name="id" value="<?php echo $id;?>" />
                       
 							<input  type="hidden" name="rurl" value="<?php echo $rurl;?>" />
 					  <?php } else { ?>
 					  	Add 
 					  	<?php } ?>

 			    </button>
			   <a href="<?= $member_base_url; ?>student/account?rurl=<?php echo $rurl;?>" class="negative">
			        <img src="<?php echo $member_image_path?>icons/cross.png" alt=""/>
			        Cancel
			   </a>
			</div>
     </td>
	</tr>
</tbody>
</table>
 </form>
 <script>
 $(document).ready(function() {
     $("#course_form").RSV({
       onCompleteHandler: frmSubmit,
       errorFieldClass: "errorDesc",
       displayType: "display-html",
       errorHTMLItemBullet: "&#8212; ",
             rules: [
                     "required,name,Please enter name."
             ]
     });
  // a custom onComplete handler to prevent form submits for the demo
     function frmSubmit()
     {
       return true;
     }

        
});
 </script>